home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / bathints.zip / BH_01.DOC next >
Text File  |  1987-10-26  |  3KB  |  79 lines

  1.  
  2.                                   BAT-HINT # 1
  3.  
  4. **************************************************************************
  5.  
  6. from the BATHINTS library... part of the BATPOWER CONFERENCE from:
  7.  
  8.                          THE PAINFRAME OPUS/FIDO 261/1004 
  9.  
  10.                         Baltimore, Maryland 1-301-488-7461
  11.  
  12. **************************************************************************
  13.  
  14.                                The COMMAND command
  15.  
  16. Command.com is an executable program just like all other .com files in DOS.
  17. Running the COMMAND command invokes a secondary command processor, using up
  18. about 3.2Kbytes of RAM. There are three optional parameters in DOS 3.1:
  19.  
  20.     /p will permanently (until reboot) load the secondary command processor
  21.     /c allows you to pass a STRING to the secondary command processor
  22.     /e sets the environment size
  23.  
  24. The /p parameter finds its greatest use when employed in the config.sys
  25. file to expand the environment. For example:
  26.  
  27.     shell=command.com /e:62 /p            [DOS 3.1] or
  28.     shell=command.com /e:32768 /p         [DOS 3.2 & 3.3]
  29.  
  30. will permanently expand the environment to the maximum 992-odd bytes
  31. allowable in DOS 3.1 (62 x 16 = 992) or 32768 bytes in DOS 3.2 or 3.3. This
  32. is very useful when long paths, many environmental variables or programs
  33. employing user defined environmental variables (i.e. answer.com... see
  34. BATPOWER.ARC) are used.
  35.  
  36. When COMMAND is run without any parameters, the new command processor fully
  37. embraces the environment of the previous command processor. So expanding
  38. the environment by issuing one of the config.sys commands shown above will
  39. also result in an equally expanded environment in any subsequent command
  40. processor. The environment of the second command processor is alterable,
  41. however, through the SET command... and changes to the environment of the
  42. secondary command processor will not affect the environment of the primary
  43. command processor. Thus, if you normally employ a long path but
  44. occasionally want to modify the path for a special application, you need
  45. only enter
  46.  
  47.     command
  48.     set path=[your new path]
  49.  
  50. to invoke a new path in the secondary command processor. All other
  51. environmental variables will remain the same. To return to the original
  52. path and command processor, just type
  53.  
  54.     exit
  55.  
  56. at the DOS prompt. Your original path will be intact.
  57.  
  58. Use of COMMAND /C is very useful for calling a batch file from another
  59. batch file. Normally, if you enter the name of a batch file from within a
  60. batch file, the second batch file will be executed but you will be unable
  61. to return to the first batch file. While this limitation has been overcome
  62. in versions of DOS >3.1 (using the CALL command), many people are still
  63. running 3.1. To call another batch file from within a batch file in DOS 3.1
  64. enter the following line in the first batch file:
  65.  
  66.     command /c batname
  67.  
  68. BATNAME.bat will be executed and will return to the next line in the
  69. original bat file. Alternatively, you could enter
  70.  
  71.     command batname
  72.  
  73. Again, BATNAME will be executed... but this time reentry into the first bat
  74. file is accomplished with the EXIT command. The EXIT command could be
  75. placed at the end of the second bat file or at some other location in the
  76. second bat file executable upon a conditional statement.
  77.  
  78. *********************************************************** David Creasey
  79.